package com.qf.cx.simplenms.reader.impl;

import java.util.Comparator;
import java.util.List;

import com.qf.cx.simplenms.link.api.LinkManager;
import com.qf.cx.simplenms.reader.model.ReaderModel;
import com.qf.cx.simplenms.tagmemory.model.TagMemoryModel;

public class SequentialTagMemoryReader extends CommonReader {

	private final Comparator<TagMemoryModel> comparator;

	public SequentialTagMemoryReader(ReaderModel readerModel, LinkManager linkManager,
			Comparator<TagMemoryModel> comparator) {
		super(readerModel, linkManager);
		this.comparator = comparator;
	}

	@Override
	protected List<TagMemoryModel> generateUniqueTagMemories() {
		List<TagMemoryModel> list = super.generateUniqueTagMemories();

		list.sort(comparator);

		return list;
	}
}
